<script>
    window._ = require('lodash');

    window.$ = window.jQuery = require('jquery');

    require('jquery-validate');
    require('libs/jquery-validation/localization/messages_zh.min.js');
    require('libs/jquery-validation/additional-methods.js');

    require('bootstrap');

    window.Promise = require('es6-promise');

    window.Vue = require('vue');

    window.axios = require('axios');

    window.moment = require('libs/moment.min.js');

    require('assets/css/master-style.css');

    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });

    $.validator.setDefaults({
//        debug: true,
//        onsubmit: false,//提交时验证
        onfocusout: false,//失去焦点时验证（不包括复选框/单选按钮）
        onkeyup: false,//在 keyup 时验证
        onclick: false,//在点击复选框和单选按钮时验证
        ignore: "",//忽略某些元素不验证，默认ignore:":hidden"不验证隐藏域
        submitHandler: function (form) {
//            alert("submitted!");
        },
        errorPlacement: function (error, element) {
//            error.appendTo(element.parent());
        },
        showErrors: function (errorMap, errorList) {
            if (errorList.length > 0) {
                alert(errorList[0].message);
            }
            this.defaultShowErrors();
        }
    });

    Vue.filter('date', function (value, formatString) {
        return moment.unix(value).format(formatString || 'YYYY-MM-DD HH:mm:ss');
    });

</script>
<style>
    /*@import '../../css/master-style.css';*/
    [v-cloak] {
        display: none;
    }
</style>